# coding=utf-8
import arcpy
import json
path = r'D:\秋声科技\shp'
arcpy.env.workspace = path
riv = r'D:\秋声科技\shp\YA_RIV_LEVEL6_4326.shp'
county = r'D:\秋声科技\shp\县域-数据库.shp'

with arcpy.da.UpdateCursor(riv,['SHAPE@','county','name']) as cursor1:
    for row1 in cursor1:
        print(row1[2])
        with arcpy.da.SearchCursor(county,['SHAPE@','county']) as cursor2:
            qxList = []
            for row2 in cursor2:
                if row2[0].crosses(row1[0]):
                    qx = row2[1]
                    qxList.append(qx)
                if row2[0].contains(row1[0]):
                    qx = row2[1]
                    qxList.append(qx)
            row1[1] = '、'.decode('utf-8').join(qxList)
        cursor1.updateRow(row1)